/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2025. All rights reserved.
 *
 */
import { ErrorCode } from './error-code.js';
import { ECM } from './error-code-map.js';

export function recordErrorCode(apiType: ECM.ApiTypeKey, moduleType: ECM.ModuleTypeKey, taskGroup: string): void {
  const instance = ErrorCode.getInstance();
  instance.setApiType(apiType);
  instance.setModuleType(moduleType);
  instance.setTaskGroup(taskGroup);
}

/**
 * 记录具体错误码
 * @param {string} dece 具体报错的错误码
 */
export function recordDECE(dece: ECM.DECE): void {
  const instance = ErrorCode.getInstance();
  instance.reset();
  instance.setDetailsError(dece);
}
